//
//  UILabel+PhotoCount.m
//  PrintFamily
//
//  Created by edaihua on 16/3/2.
//  Copyright © 2016年 ___PrintFactory___. All rights reserved.
//

#import "UILabel+PhotoCount.h"
#import "PFPrintManager.h"

@implementation UILabel (PhotoCount)

- (void)updateWithPhotoCount:(NSUInteger)count {
    NSUInteger countOne = count % 10;
    NSUInteger countTen = (count / 10) % 10;
    NSUInteger countHundred = (count / 100) % 100;
    self.text = [NSString stringWithFormat:@"%ld%ld%ld", (unsigned long)countHundred, countTen, countOne];
}

- (void)updateWithPhotoCount:(NSUInteger)count type:(PhotoPrintType)type {
    NSUInteger countOne = count % 10;
    NSUInteger countTen = (count / 10) % 10;
    NSUInteger countHundred = (count / 100) % 100;
    NSString*  photoType = [PFPrintManager getPrintTypeStringWithPrintType:type];
    
    self.text = [NSString stringWithFormat:@"%@ %ld%ld%ld", photoType, (unsigned long)countHundred, countTen, countOne];
}

@end
